<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    console.log(parseInt("123"))//123
    console.log(parseInt(123.45))//123

    console.log(parseInt("123abc"))//123
    console.log(parseInt(" 123"))//123
    console.log(parseInt("abc123"))//NaN
    console.log(parseInt(null))//NaN
    console.log(parseInt(undefined))//NaN
    console.log(parseInt())//NaN

    console.log(parseInt(101,2))//当成2进制转10进制5
    console.log(parseInt(101,8))//当成8进制转10进制65
    console.log(parseInt("a",16))//当成16进制转10进制10
    console.log(parseInt("2",2))
    console.log(parseInt("1112",2))

    console.log(String(123))   //"123"
    console.log(String(123.123))//"123.123"
    console.log(String(undefined))//"undefined"
    console.log(String(null))//"null"
    console.log(String(false))//"false"
    console.log(String(true))//"true"


    console.log(Boolean(1))//true
    console.log(Boolean("1"))//true
    console.log(Boolean(""))//false
    console.log(Boolean(null))//false
    console.log(Boolean(NaN))//false
    console.log(Boolean(false))//false
    console.log(Boolean(undefined))//false

    var demo = 123
    console.log(demo.toString())//"123"
    demo = 123.123
    console.log(demo.toString())//"123.123"
    demo = true
    console.log(demo.toString())//"true"
    demo = NaN
    console.log(demo.toString())//"NaN"
    // demo = undefined
    // console.log(demo.toString())//报错
    // demo = null
    // console.log(demo.toString())//报错


    demo = 10
    console.log(demo.toString(2))//1010  转换为2进制
    console.log(demo.toString(8))//12    转换为8进制
    console.log(demo.toString(16))//a    转换为16进制


    console.log(isNaN("123"))//false
    console.log(isNaN("123abc"))//true
    console.log(isNaN(true))//false
    console.log(isNaN(undefined))//true
    console.log(isNaN(null))//false

    var demo = "1";
    console.log(++demo)















</script>
</html>